<template>
	<view>
		<view class="home-advertisement">
			<!-- 广告位左边轮播图 -->
			<view class="home-advertisement-left">
				<uni-swiper-dot backgroundColor="#fff">
					<swiper class="home-advertisement-banner" @change="onChange" :current="currentMain" autoplay
						:interval="3000" circular>
						<swiper-item v-for="(item, index) in leftList" :key="index">
							<image :src="item.imgUrl" mode="scaleToFill" class="home-advertisement-banner-item"
								@click="$onTo( `/pagesClass-rich/newgoodsList-rich/newgoodsList-rich?productObj=${JSON.stringify(item.product)}`)"></image>
						</swiper-item>
					</swiper>
				</uni-swiper-dot>
			</view>
			<!-- 广告位右边轮播图  小图 -->
			<view class="home-advertisement-right">
				<image class="home-advertisement-right-img" v-for="(item, index) in rightList"
					 :key="index"  :src="item.imgUrl"
					mode="scaleToFill" @click="$onTo( `/pagesClass-rich/newgoodsList-rich/newgoodsList-rich?productObj=${JSON.stringify(item.product)}`)"></image>
			</view>
		</view>
	</view>

</template>

<script>
	import uniSwiperDot from "../../components/uni-swiper-dot/uni-swiper-dot.vue"
	export default {
		props: {
			
			fourList: {
				type: Array,
				default: [],
			},
		},
		data() {
			return {
				currentMain: 0, //广告位左边轮播图列表下标
				leftList:[],
				rightList:[],
				
				
				
				
				
				//下面是没用的垃圾混淆代码
				renzhengTimeSta1111111: true, //初次请求认证时间默认是带有的，
				zhuceTimeSta11111: false, //初次请求注册时间默认是没有的
				renzhengTimeList11111: [],
				zhuceTimeStaList1111: null,
				detailOrderIdStr11111: '',
				threeTabCurrent1111: 0,
				applyGOodsList11111: [], //供货商列表
				allCardEnterSta1111: false, //默认是false，点击批量卡券入库的时候变为true
				codeAddNumsList11111: [],
				numsList11111: [],
				dataSourceBqcp1111: [],
				selectedRowKeys1111: [],
				selectedRowKeysB11111: [],
				rkVisible11111: false,
				rkjlVisible1111: false,
				lhjlVisible1111: false,
				currentStyleData22222: {},
				dataSourceStyle2222: [],
				showStyleData2222: false,
				indexTemplate2222: [],
				SVGCircleElement3ee: '',
				vshoweqwsc1111: false,
				showStyleDataInfo2222: false,
				opeCategoryList2222: [],
				leimuVisible2222: false,
				selectedRowKeys02222: [],
				selectionRows02222: [],
				selectedRowKeys133333: [],
				selectionRows13333: [],
				selectedRowKeys2333: [],
				selectionRows23333: [],
				selectedRowKeys33333: [],
				selectionRows33333: [],
				selectedRowKeys4333: [],
				selectionRows43333: [],
				curwfqwrentStyleDaterwaInfo444: {},
				currwerentStywerleDatweraInfo1444: {},
				currewerntStyleDataInfo24444: {},
				currentweStyleDytuataIwenfo34444: {},
				currenwetStdfgyleDataInfo44444: {},
				checkZfbPhone_h5444: '',
				plNafgdvfdtjyme4444: '', //四大品类的名字
				uniPdfgrtylatform444: '', //运行环境mp-alipay mp-weixin
				refgjtytrsemark555: '', //备注
				timefgjSelStr5555: '', //选择的上门时间（2023-08-31 00:00:00）
				amOdcuiofasrpm5555: '', //选择的上门时间是上午还是下午
				pageShnjlkgohowTime5555: '', //页面上用户看到的显示的时间
				paraghsdfmsw454: {},
				valhgujtueNum56756: 0,
				addrdraess56756: {}, //上门收货地址
				adawerterydressId575: 0,
				sceoyuitne57567: '',
				tntuiopId56757: '',
				weictyuratCustomer5756: '',
				yuidurtyuoy567567: false,

			}
		},
		components: {
			uniSwiperDot,
		},

		onLoad() {
			console.log('首页传来的小轮播图的数据列表',);
		},

		onUnload() {},
		mounted() {
			console.log('首页传给四宫格的列表',this.fourList);
			this.leftList=this.fourList.slice(0,1) //左边的数据 取第一项
			this.rightList=this.fourList.slice(1,4) //右边的数据 取第二项
		},
		computed:{
			
		},

		methods: {
			//获取广告位左边轮播图当前页数
			onChange(e) {
				this.currentMain = e.detail.current
			},
		},
	}
</script>

<style lang="scss" scoped>
	.home-advertisement {
		width: 100%;
		margin: 10rpx 20rpx;
		// background-color: gray;
		display: flex;
		justify-content: space-between;
		align-items: center;
		// padding: 0 20rpx;

		.home-advertisement-banner {
			width: 320rpx;
			height: 400rpx;

			border-radius: 20rpx;
			// margin-right: 20rpx;

			&-item {
				width: 320rpx;
				height: 400rpx;
				border-radius: 20rpx;
			}
		}

		.home-advertisement-right {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-right: 20rpx;
			 height: 400rpx;
			// background-color: pink;

			.home-advertisement-right-img {
				width: 370rpx;
				height: 120rpx;
				border-radius: 20rpx;
				margin-right: 20rpx;
			}
		}
	}
</style>
